import { defHttp } from "@/utils/http";

// ERP 供应商投标记录 VO
export interface BidSuperBiddingVO {
	id: number; // 主键
	year: number; // 年份
	suplerId: string; // 供应商ID
	notes: string; // 备注
	amount: number; // 金额
	deductionAmount: number; // 扣除金额
}

// ERP 供应商投标记录 API
export const BidSuperBiddingApi = {
	// 查询供应商投标记录分页
	getBidSuperBiddingPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/supler-bidding/page`, params });
	},

	// 查询供应商投标记录详情
	getBidSuperBidding: async (id: number) => {
		return await defHttp.get({ url: `/whs/supler-bidding/get?id=` + id });
	},

	// 新增供应商投标记录
	createBidSuperBidding: async (data: BidSuperBiddingVO) => {
		return await defHttp.post({ url: `/whs/supler-bidding/create`, data });
	},

	// 修改供应商投标记录
	updateBidSuperBidding: async (data: BidSuperBiddingVO) => {
		return await defHttp.put({ url: `/whs/supler-bidding/update`, data });
	},

	// 删除供应商投标记录
	deleteBidSuperBidding: async (id: number) => {
		return await defHttp.delete({
			url: `/whs/supler-bidding/delete?id=` + id
		});
	},

	// 导出供应商投标记录 Excel
	exportBidSuperBidding: async (params: any) => {
		return await defHttp.download({ url: `/whs/supler-bidding/export-excel`, params });
	}
};
